import Vue from "vue";
import Vuex from "vuex";
Vue.use(Vuex);
let store = new Vuex.Store({
  strict: true,
  state: {
    /**
     * @type {UserInfo}
     */
    loginUser: null
  },
  mutations: {
    SetLoginUser(state, loginUser) {
      state.loginUser = loginUser;
    }
  }
});

export default store;
export let storeExtend = {
  commit: {
    commitLoginUser(loginUser) {
      store.commit("SetLoginUser", loginUser);
    }
  },
  state: store.state
};
